package com.changgou.goods.pojo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 某款商品的不同参数对应的商品信息
 *
 * @author gaofeng
 * @date 2025/4/19 23:00
 */
@Data
@ApiModel(description = "Sku", value = "Sku")
@Table(name = "tb_sku")
public class Sku implements Serializable {
    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    @Id
    @Column(name = "id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 商品条码
     */
    @ApiModelProperty(value = "商品条码")
    @Column(name = "sn")
    private String sn;

    /**
     * SKU名称
     */
    @ApiModelProperty(value = "SKU名称")
    @Column(name = "name")
    private String name;

    /**
     * 价格（分）
     */
    @ApiModelProperty(value = "价格（分）")
    @Column(name = "price")
    private Integer price;

    /**
     * 库存数量
     */
    @ApiModelProperty(value = "库存数量")
    @Column(name = "num")
    private Integer num;

    /**
     * 库存预警数量
     */
    @ApiModelProperty(value = "库存预警数量")
    @Column(name = "alert_num")
    private Integer alertNum;

    /**
     * 商品图片
     */
    @ApiModelProperty(value = "商品图片")
    @Column(name = "image")
    private String image;

    /**
     * 商品图片列表
     */
    @ApiModelProperty(value = "商品图片列表")
    @Column(name = "images")
    private String images;

    /**
     * 重量（克）
     */
    @ApiModelProperty(value = "重量（克）")
    @Column(name = "weight")
    private Integer weight;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * SPUID
     */
    @ApiModelProperty(value = "SPUID")
    @Column(name = "spu_id")
    private Long spuId;

    /**
     * 类目ID
     */
    @ApiModelProperty(value = "类目ID")
    @Column(name = "category_id")
    private Integer categoryId;

    /**
     * 类目名称
     */
    @ApiModelProperty(value = "类目名称")
    @Column(name = "category_name")
    private String categoryName;

    /**
     * 品牌名称
     */
    @ApiModelProperty(value = "品牌名称")
    @Column(name = "brand_name")
    private String brandName;

    /**
     * 规格
     */
    @ApiModelProperty(value = "规格")
    @Column(name = "spec")
    private String spec;

    /**
     * 销量
     */
    @ApiModelProperty(value = "销量")
    @Column(name = "sale_num")
    private Integer saleNum;

    /**
     * 评论数
     */
    @ApiModelProperty(value = "评论数")
    @Column(name = "comment_num")
    private Integer commentNum;

    /**
     * 商品状态 1-正常，2-下架，3-删除
     */
    @ApiModelProperty(value = "商品状态 1-正常，2-下架，3-删除")
    @Column(name = "status")
    private String status;
}
